package com.leesche.netdoll;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.leesche.framework.platform.redis.RedisManager;

@SpringBootApplication
@EnableScheduling
public class NettyServerApplication {

	@Bean
	public RedisManager redisManager() {
		String globalSettings = "{maxTotal:600 ,maxIdle:200 ,numTestsPerEvictionRun:1024 ," + 
				" timeBetweenEvictionRunsMillis:30000 ,minEvictableIdleTimeMillis:-1 ,softMinEvictableIdleTimeMillis:10000 ," + 
				" maxWaitMillis:5000 ,testOnBorrow:true ,testWhileIdle:true ,testOnReturn:false}";
		String modularSettings = "[{name:'terminal' , shards:[{host:'localhost' , port:6379 ,  weight:1 , db:1}]} ]";
		RedisManager redisManager = RedisManager.custom(globalSettings, modularSettings);
		return redisManager;
	}
	
	
	public static void main(String[] args) {
		SpringApplication.run(NettyServerApplication.class, args);
	}
	
}
